//
//  MatchDeviceTipsViewController.m
//  CoolTennisBall
//
//  Created by 谢伟康 on 15/12/22.
//  Copyright © 2015年 CoolLang. All rights reserved.
//

#import "MatchDeviceTipsViewController.h"

@interface MatchDeviceTipsViewController ()
@property (weak, nonatomic) IBOutlet UIButton *cancelButton;

@end

@implementation MatchDeviceTipsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self configureCancelButton];
    [self registerNotication];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)clickCancelButton:(id)sender {
    NSLog(@"取消配对设备");
    [self dismissFromParentViewControllerWithAnimationType:DetailViewControllerAnimationTypeFade];
}

- (void)configureCancelButton
{
    self.cancelButton.layer.cornerRadius = 5;
    self.cancelButton.layer.borderWidth = 0.5;
    self.cancelButton.layer.borderColor = [UIColor colorWithHex:0x7c7b80 alpha:0.5].CGColor;
}

- (void)registerNotication
{
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dismissVC) name:kMatchDeviceSuccess object:nil];
}

- (void)dismissVC
{
    [self dismissFromParentViewControllerWithAnimationType:DetailViewControllerAnimationTypeFade];
}


@end
